<html>
<head><meta charset="utf-8"><title>Cargo overrides features from `build-dependencies` · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Cargo.20overrides.20features.20from.20.60build-dependencies.60.html">Cargo overrides features from `build-dependencies`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210812900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Cargo%20overrides%20features%20from%20%60build-dependencies%60/near/210812900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jurgis Balciunas <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Cargo.20overrides.20features.20from.20.60build-dependencies.60.html#210812900">(Sep 21 2020 at 23:27)</a>:</h4>
<p>I'm working on an embedded <code>no_std</code> project and have a problem where <code>std</code> feature gets enabled by <code>build-dependencies</code>. In my project I have <code>memchr = { version = "2.3", default-features = false }</code> and it compiles fine. However, as soon as I add <code>riscv</code> dependency, <code>memchr</code> fails to compile because <code>riscv</code> has <code>memchr</code> with std enabled in <code>build-dependencies</code>. As I understand from cargo docs, <code>build-dependencies</code> should be completely isolated from normal dependencies, but the std feature flag somehow sneaks through?</p>



<a name="210813558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Cargo%20overrides%20features%20from%20%60build-dependencies%60/near/210813558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Cargo.20overrides.20features.20from.20.60build-dependencies.60.html#210813558">(Sep 21 2020 at 23:36)</a>:</h4>
<p>i think this is one of those very long lived bugs that keeps hitting embedded programmers over and over, i've run into it myself.</p>



<a name="210813793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/Cargo%20overrides%20features%20from%20%60build-dependencies%60/near/210813793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jurgis Balciunas <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/Cargo.20overrides.20features.20from.20.60build-dependencies.60.html#210813793">(Sep 21 2020 at 23:40)</a>:</h4>
<p>Yep, after hours of searching I finally digged <a href="https://github.com/rust-lang/cargo/issues/7915">https://github.com/rust-lang/cargo/issues/7915</a> which fixes the issue. Even though it still requires compiler flag, it solved the issue!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>